<?php

declare (strict_types=1);
/**
 * @copyright 深圳市易果网络科技有限公司
 * @version 1.0.0
 * @link https://dayiguo.com
 */

namespace App\Controller\user;

use App\Dao\UserFeedbackDao;
use App\Dao\VersionDao;
use App\Middleware\User\UserMiddleware;

use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\AutoController;
use Hyperf\HttpServer\Annotation\Middleware;

/**
 * 反馈控制器
 * @AutoController()
 * @Middleware(UserMiddleware::class)
 * @author 张昊(2396675557@qq.com)
 * @package App\Controller\admin
 */
class UserFeedbackController extends Controller
{
    /**
     * @Inject
     * @var UserFeedbackDao
     */
    private $user_feedback_dao;


    /**
     * 反馈增加
     */
    public function add()
    {
        $content = (string)$this->request->input('content', 0);

        $this->user_feedback_dao->create([
            'user_id'=>uid(),
            'content'=> $content,
            'created_at'=> time(),
            'updated_at'=> time()
        ]);

        $this->success();
    }
}